#include <iostream>

using namespace std;
class Location
{
public:
	Location(int xx=0,int yy=0) {X=xx; Y=yy;} //default constructor
	Location(const Location &p) //copy constructor
	{ X=p.X; Y=p.Y; 
		cout << "Copy constructor called." << endl;
	} 
	
	Location& operator=(const Location& p); //assignment
	
	int GetX() {return X;}
	int GetY() {return Y;}
	
private:
	int X,Y;
};

Location& Location::operator=(const Location& p) 
{ 
	X = p.X;
	Y = p.Y;
	cout<<"Assignment operator called."<<endl;
	return *this;
}

void test1(){
	Location A(1,2), B; 
	B=A; // Assignment operator called.
	cout<<"B="<<B.GetX()<<","<<B.GetY()<<endl;
}

void test2(){
	Location A(1,2);
	Location B=A; // Copy constructor called.
	cout<<"B="<<B.GetX()<<","<<B.GetY()<<endl;
}

int main(int argc, char *argv[]) {
	test1();
	
	cout << "========================" << endl;
	
	test2();
}